package hui.com.service.impl;

import hui.com.dao.RoleDao;
import hui.com.model.entity.PermsEntity;
import hui.com.model.entity.RoleEntity;
import hui.com.model.req.role.RequestNOTINRolePerms;
import hui.com.service.RoleService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class RoleServiceImpl implements RoleService {
    @Resource
    RoleDao roleDao;
    @Override
    public List<RoleEntity> getRoleList(RoleEntity role) {
        return roleDao.getRoleList(role);
    }

    @Override
    public Boolean addRolePerms(Integer roleID, Integer[] permsIDArray) {
        return roleDao.addRolePerms(roleID, permsIDArray);
    }

    @Override
    public Boolean deleteRolePerms(Integer roleID, Integer permsID) {
        return roleDao.deleteRolePerms(roleID, permsID);
    }

    @Override
    public List<PermsEntity> getNOTINRolePerms(RequestNOTINRolePerms role) {
        return roleDao.getNOTINRolePerms(role);
    }

    @Override
    public Integer[] getRoleUser(Integer RoleID) {
        return  roleDao.getRoleUser(RoleID);
    }
}
